import request from '@/config/axios'

// 仓库信息 VO
export interface StockStoreVO {
  id: number // 仓库主键ID
  userId: number // 用户ID
  areaId: number // 仓库地区ID
  name: string // 仓库名称
  remark: string // 仓库备注
}

// 仓库信息 API
export const StockStoreApi = {
  // 查询仓库信息分页
  getStockStorePage: async (params: any) => {
    return await request.get({ url: `/wine/stock-store/page`, params })
  },

  // 查询仓库信息详情
  getStockStore: async (id: number) => {
    return await request.get({ url: `/wine/stock-store/get?id=` + id })
  },

  // 新增仓库信息
  createStockStore: async (data: StockStoreVO) => {
    return await request.post({ url: `/wine/stock-store/create`, data })
  },

  // 修改仓库信息
  updateStockStore: async (data: StockStoreVO) => {
    return await request.put({ url: `/wine/stock-store/update`, data })
  },

  // 删除仓库信息
  deleteStockStore: async (id: number) => {
    return await request.delete({ url: `/wine/stock-store/delete?id=` + id })
  },

  // 导出仓库信息 Excel
  exportStockStore: async (params) => {
    return await request.download({ url: `/wine/stock-store/export-excel`, params })
  }
}